package com.atguigu.ggkt.sequence.api;

import com.atguigu.ggkt.result.Result;
import com.atguigu.ggkt.sequence.service.SequenceService;
import com.atguigu.ggkt.sequence.service.impl.SequenceImpl_1;
import com.atguigu.ggkt.utils.SpringTool;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "优惠券接口")
@RestController
@RequestMapping("/api/sequence")
public class SequenceApiController {

    @ApiOperation(value = "内部系统获取sequence")
    @GetMapping(value = "inner/get")
    public Result getOne() {
        SequenceService service = (SequenceService) SpringTool.getSpringBean(SequenceImpl_1.class);
        String seq = service.create();
        return Result.ok(seq);
    }
}
